1. Field of the Invention
The present general inventive concept relates to an apparatus using a flash memory as storage and a method of operating the same, and more particularly, to an apparatus using a flash memory as storage and a method of operating the same, which can provide an optimized architecture to a flash memory through combination of an FTL (Flash Translation Layer) with a database.
2. Description of the Related Art
Generally, in an embedded system, such as a home appliance, a communication appliance, a set top box, and the like, a nonvolatile memory has been widely used as a storage medium for storing and processing data.
A flash memory, which is a type of nonvolatile memory, is a nonvolatile storage device that can electrically delete or rewrite data. Since the flash memory has a low power consumption in comparison to a storage medium based on a magnetic disk memory, a rapid access time in comparison to a hard disk, and a small size, the flash memory is suitable to be used in a portable device.
Such a flash memory has a different characteristic from a magnetic storage medium, such as a hard disk. Specifically, in the flash memory, data read/write operation can be performed in a unit of a page, but data update work cannot be performed in the unit of the page. In order to perform the data update work in the flash memory, a delete operation in the unit of a block that is composed of a plurality of pages is required, and generally, the delete unit is larger than the write unit. This feature of the flash memory is difficult using a file system designed based on a hard disk.
Accordingly, in order to complement the characteristic that the delete unit is larger than the write unit in the flash memory and the characteristic that the number of deletions is limited in the flash memory, and to use a file system designed based on a hard disk, a flash translation layer (FTL) has been developed. The FTL is a type of software layer allowing flash memory to be used in the same manner as a hard disk.
Recently, with an increase of the capacity of a flash memory, a large amount of data can be stored in flash memory. Accordingly, the use of a database is essential in an apparatus using the flash memory as storage. For example, in an apparatus using the flash memory as storage, log-based recovery and shadow paging techniques have been used as mechanisms for data recovery.
The log-based recovery technique generates log records for changes in the database, stores the log records in the disk, and uses the log records for the database recovery. The log records for the changes include previous data and new data for the changed data, and are written in the disk via log buffers as needed. According to this log-based recovery technique, the log records, which usually are very small, are frequently written in the disk whenever the changes are generated. Accordingly, pages are frequently used due to the frequent writing of the log records, and thus a deletion operation, which is relatively slow in comparison to the read/write operation, is frequently performed in order to withdraw the pages that have become ineffective.
If a specified page is updated, the shadow paging technique updates data of the corresponding page by making a copy of the page in another page, without using the log records. If a transaction is terminated, the technique reflects the transaction in a new disk, while if the transaction is aborted, the technique discards the copy. According to the shadow paging technique, the frequent writing of the log records as in the log-based recovery technique is not performed, but is required to separately manage a page table for managing pages in which copies of the updated pages are written. That is, the database manages the mapping operation between logical addresses and physical addresses. However, since the physical addresses managed in the database are once again translated into physical addresses through the mapping table managed by the FTL and the mapping information is managed by the database and the FTL, unnecessary duplication work is performed.
Accordingly, there is a need for a database architecture that considers the characteristic of a flash memory in an apparatus using the flash memory as storage.
Korean Patent Unexamined Publication No. 2004-0082921 relates to a flash file system which has an FTL (Flash Translation Layer) and performs mapping of logical addresses received from a host system on physical addresses of a flash memory. This flash file system, however, still fails to propose a database architecture that considers the characteristic of a flash memory in an apparatus using the flash memory as storage.